﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace DevWeb.Biztalk.DeploymentSettings.Data.CodeFirst.Configurations
{
    public class ExtendedEntityTypeConfiguration<TEntity> : EntityTypeConfiguration<TEntity> where TEntity:class 
    {
        public UniqueConstraintConfiguration<TEntity> HasUnique(string propertyName)
        {
            var result = new UniqueConstraintConfiguration<TEntity>();
            result.WithColumn(propertyName);
            return result;
        }
        public UniqueConstraintConfiguration<TEntity> HasUnique<TProperty>(Expression<Func<TEntity, TProperty>> property)
        {
            var result = new UniqueConstraintConfiguration<TEntity>();
            result.WithColumn(property);
            return result;
        }
    }
}
